﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Account.aspx.cs" Inherits="WSS.hameduconn.Account" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <script src="Scripts/jquery-1.8.2.js"></script>
    <script src="Scripts/jquery-ui-1.8.24.js"></script>
    <script>
        $(function () {
            $("#<%= tbExpirationDate.ClientID %>").datepicker();
        });
    </script>
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">User Management</h1>
        </div>
        <!-- /.col-lg-12 -->
    </div>
    <!-- /.row -->
    <div class="row text-right" style="margin: 15px 0;">
        <div class="col-lg-12">
            <asp:Button ID="btnAdd" runat="server" Text="Create new account" CssClass="btn btn-success" OnClick="btnAdd_Click" />
            <asp:Button ID="btnBack" runat="server" Text="Back" CssClass="btn btn-danger" OnClick="btnBack_Click" />
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="alert alert-warning alert-danger" id="divAlert" runat="server">
                <a class="close" data-dismiss="alert">×</a>
                <strong runat="server" id="MessageTitle">Lorem ipsum!</strong> <span id="MessageText" runat="server">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris vitae tristique erat.</span>
            </div>
        </div>
    </div>
    <div class="row" id="memberUsers" runat="server">
        <div class="col-lg-12 col-sm-12 col-xs-12 table-responsive">
            <asp:GridView ID="grdViewMemberHistory" runat="server" ShowHeaderWhenEmpty="true" GridLines="None" EmptyDataText="No data" CssClass="table table-striped table-bordered table-hover" AutoGenerateColumns="False" CellPadding="0"
                DataKeyNames="Id"
                OnRowDataBound="grdViewMemberHistory_RowDataBound">
                <Columns>
                    <asp:TemplateField HeaderText="No">
                        <ItemTemplate>
                            <asp:Label ID="lblNo" runat="server"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="User name">
                        <ItemTemplate>
                            <asp:Label ID="lblUsername" runat="server" Text='<%# Eval("Username") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Email">
                        <ItemTemplate>
                            <asp:Label ID="lblEmail" runat="server" Text='<%# Eval("Email") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="First name">
                        <ItemTemplate>
                            <asp:Label ID="lblFname" runat="server" Text='<%# Eval("FirstName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Last name">
                        <ItemTemplate>
                            <asp:Label ID="lblLname" runat="server" Text='<%# Eval("LastName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Street">
                        <ItemTemplate>
                            <asp:Label ID="lblStreet" runat="server" Text='<%# Eval("Street") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="City">
                        <ItemTemplate>
                            <asp:Label ID="lblCity" runat="server" Text='<%# Eval("City") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="State">
                        <ItemTemplate>
                            <asp:Label ID="lblState" runat="server" Text='<%# Eval("State") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Zip code">
                        <ItemTemplate>
                            <asp:Label ID="lblZipcode" runat="server" Text='<%# Eval("Zipcode") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Credit card no">
                        <ItemTemplate>
                            <asp:Label ID="lblCreditCardNo" runat="server" Text='<%# Eval("CreditCardNo") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Exp">
                        <ItemTemplate>
                            <asp:Label ID="lblExpirationDate" runat="server"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="CVS">
                        <ItemTemplate>
                            <asp:Label ID="lblCVS" runat="server" Text='<%# Eval("CVS") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="#">
                        <ItemTemplate>
                            <asp:ImageButton ID="ibtEdit" runat="server" ImageUrl="~/img/edit.png"
                                ToolTip="Modify" OnCommand="ibtEdit_Command" CommandArgument='<%# Eval("Id") %>' />
                            <asp:HyperLink Style="float: right" ID="ibtDelete" data-toggle="modal" title="Delete" data-id='<%# Eval("Id") %>' data-target="#myModal" CssClass="btnDelete" runat="server" ImageUrl="~/img/delete-item.png"
                                ToolTip="" />
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
        <div class="col-lg-12 text-right" id="divPaging" runat="server" style="padding-top: 10px; float: right">
        </div>
    </div>
    <div id="memberSection" class="row" runat="server">
        <div class="col-lg-12">
            <div class="col-lg-6">
                <div class="col-lg-12">
                    <asp:Label ID="lblUsername" runat="server" Text="Username"></asp:Label>
                    <span class="red">(*)</span>
                    <asp:TextBox ID="tbUsername" runat="server" class="form-control"></asp:TextBox>
                </div>
                <div class="col-lg-6">
                    <asp:Label ID="lblPassword" runat="server" Text="Password"></asp:Label>
                    <span class="red">(*)</span>
                    <asp:TextBox ID="tbPassword" TextMode="Password" runat="server" class="form-control"></asp:TextBox>
                </div>
                <div class="col-lg-6">
                    <asp:Label ID="lblConfirmPassword" runat="server" Text="Confirm password"></asp:Label>
                    <span class="red">(*)</span>
                    <asp:TextBox ID="tbConfirmPassword" TextMode="Password" runat="server" class="form-control"></asp:TextBox>
                </div>
                <div class="col-lg-12">
                    <asp:Label ID="lblEmail" runat="server" Text="Email"></asp:Label>

                    <asp:TextBox ID="tbEmail" runat="server" class="form-control"></asp:TextBox>
                </div>
                <div class="col-lg-6">
                    <asp:Label ID="lblFirstName" runat="server" Text="First name"></asp:Label>

                    <asp:TextBox ID="tbFirstName" runat="server" class="form-control"></asp:TextBox>
                </div>
                <div class="col-lg-6">
                    <asp:Label ID="lblLastName" runat="server" Text="Last name"></asp:Label>
                    <asp:TextBox ID="tbLastName" runat="server" class="form-control"></asp:TextBox>
                </div>
            </div>
            <div class="col-lg-6">
                <div class="col-lg-6">
                    <asp:Label ID="lblStreet" runat="server" Text="Street"></asp:Label>
                    <asp:TextBox ID="tbStreet" runat="server" class="form-control"></asp:TextBox>
                </div>
                <div class="col-lg-6">
                    <asp:Label ID="lblCity" runat="server" Text="City"></asp:Label>

                    <asp:TextBox ID="tbCity" runat="server" CssClass="form-control"></asp:TextBox>
                </div>
                <div class="col-lg-6">
                    <asp:Label ID="lblState" runat="server" Text="State"></asp:Label>
                    <asp:TextBox ID="tbState" runat="server" class="form-control"></asp:TextBox>
                </div>
                <div class="col-lg-6">
                    <asp:Label ID="Zipcode" runat="server" Text="Zip code"></asp:Label>
                    <asp:TextBox ID="tbZipcode" runat="server" CssClass="form-control"></asp:TextBox>
                </div>
                <div class="col-lg-12">
                    <asp:Label ID="lblCreditCard" runat="server" Text="Credit card no"></asp:Label>

                    <asp:TextBox ID="tbCreditNo" runat="server" CssClass="form-control"></asp:TextBox>
                </div>
                <div class="col-lg-6">
                    <asp:Label ID="lblExpirationDate" runat="server" Text="Expiration date"></asp:Label>

                    <asp:TextBox ID="tbExpirationDate" runat="server" placeholder="__/__/____" class="form-control"></asp:TextBox>
                </div>
                <div class="col-lg-6">
                    <asp:Label ID="lblCVS" runat="server" Text="CVS"></asp:Label>
                    <asp:TextBox ID="tbCVS" runat="server" class="form-control"></asp:TextBox>
                </div>
            </div>
            <div class="col-lg-12" style="margin: 15px 0">
                <div class="col-lg-12 text-right">
                    <asp:Button ID="btnRegister" runat="server" Text="Create" CssClass="btn btn-green" OnClick="btnCreate_Click" />
                    <asp:Button ID="btnUpdate" runat="server" Text="Update" CssClass="btn btn-blue" OnClick="btnUpdate_Click" />
                </div>
            </div>
        </div>
    </div>
    <asp:HiddenField ID="hdUserId" runat="server" Value="0" />
    <!-- Modal -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="myModalLabel">Confirm</h4>
                </div>
                <div class="modal-body">
                    Are you want delete?
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <asp:Button ID="btnDelete" OnClick="btnDelete_Click" runat="server" CssClass="btn btn-primary" Text="Delete" />
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            $('.btnDelete').click(function () {
                var id = $(this).attr('data-id');
                $('#<%=hdUserId.ClientID%>').val(id);
            });
        });
    </script>
</asp:Content>
